A face detection technology refers to a process of determining whether a face is included in an image or a video and determining a face position and a scale. A precondition for implementing face detection is to construct a face detector. Generally, a face detector is constructed by using the following manners in the prior art.
Technology 1: A Haar-Like feature and an Adaboost algorithm are used to implement face detection. In this method, the Haar-Like feature is used to represent a face, training is performed on each Haar-Like feature to obtain a weak classifier, multiple weak classifiers that can most represent a face are selected by using the Adaboost algorithm to construct a strong classifier, and several strong classifiers are connected in series to form a cascading classifier of a cascading structure, that is, a face detector. In this technology, only face image information of a pivot block and one neighbor block is considered in each Haar-Like feature. As a result, the number of Haar-Like features is large, an identification capability is weak, a large number of weak classifiers generally need to be trained, an overall identification capability is weak, and eventually a face detection rate is low.
Technology 2: A multi-scale block local binary pattern (MBLBP) feature and the Adaboost algorithm are used to implement face detection. This method is based on Technology 1. An MBLBP feature of face image information of a pivot block and 8 neighbor blocks is used to represent a face. The MBLBP feature is calculated by comparing average grayscale of the pivot block with average grayscale of each of the 8 peripheral neighbor blocks. Details are shown in FIG. 1. FIG. 1 is a schematic diagram of an MBLBM feature in the prior art. In this technology, it is required that the 8 neighbor blocks must be evenly distributed around the pivot block, and the pivot block must be adjacent to each of the neighbor block. A reference value for comparison is fixed as 0 when an average grayscale value of a training sample is calculated. As a result, robustness of an MBLBP feature to noise is poor, a false detection rate of face detection is high, and user experience of face detection is poor.
Technology 3: A multi-scale structured ordinal feature (MSOF) and the Adaboost algorithm are used to implement face detection. This method is based on Technology 2. An MSOF feature of face image information of a pivot block and 8 neighbor blocks is used to represent a face. A distance of the 8 neighbor blocks relative to the pivot block is adjustable, and the pivot block may not be adjacent to the 8 neighbor blocks. Details are shown in FIG. 2. FIG. 2 is a schematic diagram of an MSOF feature in the prior art. In this technology, it is required that space positions of the 8 neighbor block relative to the pivot block are evenly distributed. Flexibility is poor, robustness is restricted to a certain extent, and a false detection rate of a face detector is high.